/*
 * @Author: sonss
 * @Date: 2024-08-26 12:19:24
 * @LastEditTime: 2024-08-26 16:53:18
 * @FilePath: /ss-file-antd/src/services/assets_category.ts
 * @Description:  资源分类
 */

import { request } from '@umijs/max';

// 分类树
export async function Trees(body?: ASSETS.CATEGORY.AllRequest) {
  return request<API.Result<ASSETS.CATEGORY.TreesResponse>>('/v1/assets/category/trees', {
    method: 'POST',
    data: body || {},
  });
}

// 详情
export async function Detail(body: ASSETS.CATEGORY.GetRequest) {
  return request<API.Result<ASSETS.CATEGORY.DetailResponse>>('/v1/assets/category/detail', {
    method: 'POST',
    data: body,
  });
}

// 保存
export async function Save(body: ASSETS.CATEGORY.SaveForm) {
  return request<API.Result<any>>('/v1/assets/category/save', {
    method: 'POST',
    data: body,
  });
}

// 切换显示/隐藏
export async function ToggleHidden(body: ASSETS.CATEGORY.HiddenToggleForm) {
  return request<API.Result<any>>('/v1/assets/category/toggle-hidden', {
    method: 'POST',
    data: body,
  });
}

// 移除
export async function Remove(body: ASSETS.CATEGORY.RemoveForm) {
  return request<API.Result<any>>('/v1/assets/category/remove', {
    method: 'POST',
    data: body,
  });
}
